//所有的异步加载路由
//不要根据服务器返回的用户权限不同来进行动态筛选,从而生成页面需要展现的路由结构
//暂停管理员权限是1,2是一般用户
export const allAsyncRouter = [
  {
    path: "/order", //订单管理
    rouePath: "/order",
    name: "订单管理",
    icon: "icon-dingdanguanli",
    component: () => import("@/views/layout/index.vue"),
    redirect: "/order/order-list",
    meta: {
      title: "订单管理",
      //所属权限
      roleType: [1, 2],
    },
    children: [
      {
        rouePath: "/order/order-list",
        path: "order-list",
        name: "订单列表",
        icon: "icon-dingdan_dingdanliebiao",
        component: () => import("@/views/order/list/index.vue"),
        meta: {
          title: "订单列表",
          //所属权限
          roleType: [1, 2],
        },
      },
      {
        path: "contract",
        rouePath: "/order/contract",
        icon: "icon-sh_dingdanshenhe",
        name: "订单审核",
        component: () => import("@/views/order/contract/index.vue"),
        meta: {
          title: "订单审核",
          roleType: [1],
        },
      },
    ],
  },
  {
    path: "/product", //产品管理
    rouePath: "/product",
    icon: "icon-chanpinguanli",
    name: "产品管理",
    component: () => import("@/views/layout/index.vue"),
    redirect: "/product/list",
    meta: {
      title: "产品管理",
      //所属权限
      roleType: [1, 2],
    },
    children: [
      {
        path: "list",
        rouePath: "/product/list",
        name: "产品列表",
        icon: "icon-dingdan_dingdanliebiao",
        component: () => import("@/views/product/list/index.vue"),
        meta: {
          title: "产品列表",
          //所属权限
          roleType: [1, 2],
        },
      },
      {
        path: "category",
        rouePath: "/product/category",
        name: "产品分类",
        icon: "icon-fenlei",
        component: () => import("@/views/product/category/index.vue"),
        meta: {
          title: "产品分类",
          roleType: [1],
        },
      },
    ],
  },
  {
    path: "/ui",
    rouePath: "/ui",
    icon: "icon-shujuguanli",
    name: "自定义组件",
    component: () => import("@/views/layout/index.vue"),
    redirect: "/ui/course",
    meta: {
      title: "自定义组件",
      //所属权限
      roleType: [1, 2],
    },
    children: [
      {
        path: "course",
        rouePath: "/ui/course",
        name: "轮播图",
        icon: "icon-shujuzhanshi",
        component: () => import("@/views/ui/course/index.vue"),
        meta: {
          title: "轮播图",
          //所属权限
          roleType: [1, 2],
        },
      },
      {
        path: "magnify",
        rouePath: "/ui/magnify",
        name: "图片放大镜",
        icon: "icon-shujuzhanshi",
        component: () => import("@/views/ui/magnify/index.vue"),
        meta: {
          title: "图片放大镜",
          //所属权限
          roleType: [1, 2],
        },
      },
      {
        path: "stars",
        rouePath: "/ui/stars",
        name: "五星好评",
        icon: "icon-shujuzhanshi",
        component: () => import("@/views/ui/stars/index.vue"),
        meta: {
          title: "五星好评",
          //所属权限
          roleType: [1, 2],
        },
      },
      {
        path: "putllToRefresh",
        rouePath: "/ui/putllToRefresh",
        name: "下拉刷新",
        icon: "icon-shujuzhanshi",
        component: () => import("@/views/ui/putllToRefresh/index.vue"),
        meta: {
          title: "下拉刷新",
          //所属权限
          roleType: [1, 2],
        },
      },
    ],
  },
  {
    path: "/data", //数据管理
    rouePath: "/data",
    icon: "icon-shujuguanli",
    name: "数据管理",
    component: () => import("@/views/layout/index.vue"),
    redirect: "/data/screen",
    meta: {
      title: "数据管理",
      //所属权限
      roleType: [1, 2],
    },
    children: [
      {
        path: "screen",
        rouePath: "/data/screen",
        name: "数据展示",
        icon: "icon-shujuzhanshi",
        component: () => import("@/views/data/screen/index"),
        meta: {
          title: "数据展示",
          //所属权限
          roleType: [1, 2],
        },
      },
    ],
  },
];
